local skill_class = require 'types.skill'.__index
local color1 = {
    ['物理'] = '|cffff6600%s%%物理伤害|r',
    ['魔法'] = '|cff3366ff%s%%魔法伤害|r',
    ['适应'] = '|cffffffcc%s%%适应伤害|r',
}
local color2 = {
    ['普攻'] = '|cffff9900普攻输出|r',
    ['技能'] = '|cff00ffff技能输出|r',
    ['适应'] = '|cff00ffff适应输出|r',
}


skill_class.attack_type = '普攻'
skill_class.damage_type = '物理'
function skill_class:dmg_tp()
    return ('%s(%s)'):format(color1[self.damage_type]:format(self.rate1),color2[self.attack_type])
end


--白圈
ac.hint_white = function(point,area,time)
    local effect = point:effect
    {
        hide_when_remove = true,
        model = [[dea6d556c11037ec0783b7dbbaea9f7f.mdl]],
        size = area/176,
        time = time,
    }
    return effect
end

--白圈
ac.hint_white2 = function(point,area,time)
    local effect = point:effect
    {
        hide_when_remove = true,
        model = [[range_circle.mdl]],
        size = area/500,
        time = time,
        height = 0,
    }
    return effect
end

--红圈
ac.hint_red = function(point,area,time)
    local time = time or 99999
    local point = point:get_point()
    local effect = point:effect
    {
        hide_when_remove = true,
        model = [[030f7916c9e400e1877b010d6ef5cb08.mdl]],
        size = area/512,
        speed = 1/time,
        time = time,
    }
    return effect
end


local mt = ac.buff['临时属性']
mt.cover_type = 1
mt.cover_max = 0
mt.keep = 1

function mt:on_add()
    local hero = self.owner
    local sx = self.sx or {}
    for key,num in pairs(sx) do
        self:gc(hero:add(key,num))
    end
end


ac.buff('属性转化'){
    cover_type = 1,
    cover_max = 0,
    keep = 1,
    data1 = 1,
    data2 = 1,
    max = nil,
    pulse = 1,
    count = 0,
    on_pulse = function(self)
        local hero = self.owner
        local num1 = math.floor(hero:get(self.key1)/self.data1) * self.data2
        if self.max then
            num1 = math.min(num1,self.max)
        end
        hero:add(self.key2,num1 - self.count)
        self.count = num1
    end,
    on_remove = function(self)
        local hero = self.owner
        hero:add(self.key2,-self.count)
    end,
}
